package com.enterprise.web;

import java.io.*;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Forwards to an error message
 * @author  yunki
 */
public class MessageCommand implements Command {

    /** Creates a new instance of ErrorCommand */
    public MessageCommand() {
    }

    public String execute(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        //TODO: set the response content type to "text/html" here
        //TODO: You'll have to use getWriter() to output some HTML texts 
        //TODO: close the output stream
        String message = (String) request.getAttribute("message");
        request.setAttribute("message", message);
        return "/message.jsp";

    }
}
